package user

import (
	"github.com/gogf/gf/v2/crypto/gmd5"
	"github.com/gogf/gf/v2/util/guid"
	"wx_build/model/tables"
	"wx_build/utils"
)

func Init() {
	username := utils.GetConfig("default_user").String()
	password := utils.GetConfig("default_password").String()
	user := tables.User{
		Username: username,
		Password: gmd5.MustEncryptString(password),
	}
	err := user.QueryOne(&user)
	if err != nil {
		user.UserId = guid.S()
		user.Add(&user)
	}

}
